<?php
/*------------------------------------------------------------------------
 # Sot Virtuemart Simple Silder  - Version 1.0
 # @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 # @Author: Sky Of Tech
 # @Websites: http://skyoftech.com
 # @Email: contactnum1@gmail.com
 # Copyright (C) 2010-2011 Sky Of Tech. All Rights Reserved.
 -------------------------------------------------------------------------*/

defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<div class="sotss-theme<?php echo $theme;?>">
<ul id="SotSimpleSlider_<?php echo $module->id;?>" class="sotss-skin-tango" >
	<?php foreach($items as $key=>$item): ?>
    	<li> 
			<div class="SotSimpleSlider_item" >
				<div class="media">
					<img src="<?php echo $item['thumb'];?>" alt="<?php echo $item['sub_title'];?>" />
				</div>
				<div class="contentSlider">
					<?php if($showCaption):?>
						<div class="ss_title"><a href="<?php echo $item['link'];?>"><?php echo $item['sub_title'];?></a></div>
					<?php endif;?>
					<?php if($showDesc):?>
						<div class="ss_content">
							<?php echo $item['sub_content'];?>
						</div>
					<?php endif;?>	
					<?php if($showReadmore):?>
						<div class="ss_readmore">
							<a href="<?php echo $item['link'];?>" class="readmore"><?php echo JText::_('Read more ++');?></a>
						</div>
					<?php endif;?>
				</div>
			</div> 
		</li>
	<?php endforeach; ?>
</ul>
</div>
<?php if($count_item>=1):?>
	<script type="text/javascript">
		jSot(document).ready(function($) {
			$('#SotSimpleSlider_<?php echo $module->id;?>').jcarousel({
				vertical: <?php echo ($displayType)?"true":"false"; ?>,
				start: 1,
				scroll: <?php echo $scrollItems;?>,
				visible: <?php echo $numberItems;?>,
				animation: 'normal',
				easing: 'swing',
				auto: parseInt(<?php echo $autoPlay;?>),
				wrap: 'circular',
				setupCallback: setitemheight_<?php echo $module->id;?>
			});
			
		});
		function setitemheight_<?php echo $module->id;?>(){
				var $list_li = jSot('#SotSimpleSlider_<?php echo $module->id;?>').children('li');
				var $max_h = 0;
				jSot.each($list_li, function(key, val){
					if(parseInt(jSot(val).height())>$max_h)
					{
						$max_h = parseInt(jSot(val).height());
					}					
				})
				
				jSot.each($list_li, function(key, val){
					jSot(val).children('div').height($max_h);
				})
				
				<?php if($displayType):?>
					jSot('#SotSimpleSlider_<?php echo $module->id;?>').parent('.sotss-clip-vertical').parent('.sotss-container-vertical').css('height',($max_h+10)*parseInt(<?php echo $numberItems;?>))
					jSot('#SotSimpleSlider_<?php echo $module->id;?>').parent('.sotss-clip-vertical').css('height',($max_h+10)*parseInt(<?php echo $numberItems;?>))
				<?php endif;?>
			}
	</script>
	
<?php endif; ?>